import axios from "axios"
import {BASEURL} from "../../setting.js"
// axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; 
export function request(config){
    const instance = axios.create({
        method:"post",
        baseURL:BASEURL,
        timeout:100000,
    })
    instance.interceptors.request.use(cfg=>{
        // cfg.headers.token = sessionStorage.getItem("token")
        return cfg
    })
    instance.interceptors.response.use(res=>{
        return res.data
    })
    return instance(config)
}